<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>大风车</title>
		<script src="../js/jquery-1.11.1.js"></script>
		<style>
			.imga{
				animation: dfc .8s linear infinite;
			}
			.imgb{
				animation: dfb .8s linear infinite;
			}
			/*关键帧*/
			@keyframes dfc{
				0%{
					transform:translate(20px) rotate(180deg) scale(1);
				}
				30%{
					transform:translate(360px) rotate(360deg) scale(0.8);
				}
				100%{
					transform:translate(1540px) rotate(720deg) scale(0.5);
				}
			}
			
			/*关键帧*/
			@keyframes dfb{
				0%{
					transform:translate(20px) rotateX(180deg) scale(1);
				}
				30%{
					transform:translate(360px) rotateX(360deg) scale(0.8);
				}
				100%{
					transform:translate(1540px) rotateX(720deg) scale(0.5);
				}
			}
		</style>
	</head>
	<body>
		<img src="../img/dfc.jpg" alt="1" />
		<audio src="../img/贝乐虎儿歌 - 大风车.ogg" autoplay></audio>
		<button id="btn1">开转</button>
		<button id="btn2">暂停</button>
		<button id="btn3">翻转</button>
		<script>
			//点击  开转  图片切换并且添加样式  .imga
			$("#btn1").click(function(){
				$("img").attr("src","../img/dfc.jpg").addClass("imga");
				$("audio").attr("src","../img/贝乐虎儿歌 - 大风车.ogg").addClass("imga");
			});
			//暂停   音乐消失+动画消失
			$("#btn2").click(function(){
				$("audio").removeAttr("src");
				$("img").removeClass("imga imgb");
			});
			//翻转   切换    imga  切换imgb
			$("#btn3").click(function(){
				$("img").attr("src","../img/dfc.jpg").toggleClass("imgb");
				$("audio").attr("src","../img/贝乐虎儿歌 - 大风车.ogg");
			});
		</script>
	</body>
</html>